/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once


//#include <向量.h>
#include "引擎数据类型.h"
#include "../PBF_GPU数据.h"




void f_CUDA_计算施加外力和速度叠加(
	S_PBF_Gpu& pdf,
	vec3 重力,
	vec2 步长范围,
	float32& 更新步长,
	uint64 粒子数,

	//S_cuAdjacencyIndex& 邻接索引,
	S_DomProp& 域属性,

	bool 是否拷回CPU
	/*vec3* 位置,
	vec3* 上一帧坐标,
	vec3* 速度,
	vec3* 加速度,
	vec3* 移动变化量,
	//vec3* 外力,
	float32* 重量,
	vec2 步长范围,
	uint64 粒子数,
	uint16 线程块大小 = 1024*/
);


void f_GPU_添加外力(S_PBF_Gpu& pbf, S_PBF粒子发射& body);
void f_GPU_置粒子位置(S_PBF_Gpu& pbf, S_PBF粒子发射& body);

void f_GPU_坐标钳到域内(S_PBF_Gpu& pbf, S_DomProp& 域属性, uint64 粒子数);

void f_CUDA_计算投影约束(S_PBF_Gpu& pbf, S_cuAdjacencyIndex& 邻接索引, S_DomProp& 域属性, uint64 粒子数);

void f_CUDA_更新粒子速度(S_PBF_Gpu& pbf, S_cuAdjacencyIndex& 邻接索引, S_DomProp& 域属性, uint64 粒子数);

//void f_CUDA_解算粘度(vec3* 粒子坐标, vec3* 速度, float32 粘度);
void f_CUDA_get坐标范围粒子(S_PBF_Gpu& GPU数据, S_cuAdjacencyIndex& 邻接索引, S_DomProp& dom, vec3 x, std::vector<vec3>& particle);






